{include file="public/layout" /}
<link rel="stylesheet" type="text/css" href="/static/design_page/designer.css" media="all">
<style>
	#urlqr img{margin:0 auto}
	.fe-tab-link::-webkit-scrollbar {width: 2px;height: 0px;}
	.fe-tab-link::-webkit-scrollbar-thumb {border-radius: 1px;-webkit-box-shadow: inset 0 0 1px rgba(0,0,0,0.5);background: rgba(0,0,0,0.5);}
	.fe-tab-link::-webkit-scrollbar-track {-webkit-box-shadow: inset 0 0 0px rgba(0,0,0,0.2);border-radius: 0;background: rgba(0,0,0,0);}
</style>
<body style="margin:0;">
<div class="layui-fluid">
<div class="layui-row layui-col-space15">
	<div class="layui-card layui-col-md12">
	<div class="layui-tab">
		<ul class="layui-tab-title">
				<li id="fe-tab-link-nav-1" style="padding:0 8px" class="layui-this">基础功能</li>
				<li id="fe-tab-link-nav-2" style="padding:0 8px">商品分类</li>
				<li id="fe-tab-link-nav-3" style="padding:0 8px">商品分组</li>
				<li id="fe-tab-link-nav-4" style="padding:0 8px">商城商品</li>
				<li id="fe-tab-link-nav-8" style="padding:0 8px">文章分类</li>
				<li id="fe-tab-link-nav-9" style="padding:0 8px">文章</li>
				<li id="fe-tab-link-nav-10" style="padding:0 8px">商家分类</li>
				<li id="fe-tab-link-nav-11" style="padding:0 8px">商家</li>
				<li id="fe-tab-link-nav-12" style="padding:0 8px">设计页面</li>
				<li id="fe-tab-link-nav-13" style="padding:0 8px">功能</li>
		</ul>
		<div class="layui-tab-content" style="padding:0">
			<!--*****************************基础功能*****************************************-->
			<div class="layui-tab-item layui-show fe-tab-link" id="fe-tab-link-1">
				<div class="page-header" style="margin:20px 0 0 0;padding-bottom:0">
						<h4><i class="fa fa-folder-open-o"></i> 基础页面</h4>
				</div>
				<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-left:10px;margin-top:10px" onclick="chooseLink(1,'/pages/index/index','首页')">首页</div>
				<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-top:10px" onclick="chooseLink(1,'/pages/my/my','{:t('会员')}中心')">{:t('会员')}中心</div>
				<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-top:10px" onclick="chooseLink(1,'/pages/shop/classify','分类商品')">分类商品</div>
				<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-top:10px" onclick="chooseLink(1,'/pages/shop/prolist','商品列表')">商品列表</div>
				<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-top:10px" onclick="chooseLink(1,'/pages/gouwuche/gouwuche','购物车')">购物车</div>
				<div class="page-header" style="margin:10px 0 0 0;padding-bottom:0">
						<h4><i class="fa fa-folder-open-o"></i> 商城页面</h4>
				</div>
				<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-top:10px" onclick="chooseLink(1,'/pages/shop/classify','分类商品')">分类商品</div>
				<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-top:10px" onclick="chooseLink(1,'/pages/shop/prolist','商品列表')">商品列表</div>
				<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-top:10px" onclick="chooseLink(1,'/pages/shop/cart','购物车')">购物车</div>
				<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-top:10px" onclick="chooseLink(1,'/pages/shop/search','商品搜索')">商品搜索</div>
				<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-top:10px" onclick="chooseLink(1,'/pages/myorder/orderlist','订单列表')">订单列表</div>
				{foreach $leixing_arr as $v}
					<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-top:10px" onclick="chooseLink(1,'/pages/shop/prolist?leixing_id={$v.id}','{$v.name}')">{$v.name}</div>
				{/foreach}

<!--					<div class="page-header" style="margin:10px 0 0 0;padding-bottom:0">-->
<!--							<h4><i class="fa fa-folder-open-o"></i> 活动页面</h4>-->
<!--					</div>-->
<!--					<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-top:10px" onclick="chooseLink(1,'/pagesExt/sign/index','签到')">签到</div>-->
				<div class="page-header" style="margin:10px 0 0 0;padding-bottom:0">
						<h4><i class="fa fa-folder-open-o"></i> 会员中心</h4>
				</div>
				<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-left:10px;margin-top:10px" onclick="chooseLink(1,'/pages/my/my','会员中心')">会员中心</div>
<!--					<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-top:10px" onclick="chooseLink(1,'/pagesExt/my/favorite','我的收藏')">我的收藏</div>-->
<!--					<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-top:10px" onclick="chooseLink(1,'/pagesExt/my/history','我的足迹')">我的足迹</div>-->
				<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-top:10px" onclick="chooseLink(1,'/pages/money/recharge','会员充值')">会员充值</div>
				<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-top:10px" onclick="chooseLink(1,'/pages/money/moneylog','余额明细')">余额明细</div>
				<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-top:10px" onclick="chooseLink(1,'/pages/money/withdraw','余额提现')">余额提现</div>
				<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-left:10px;margin-top:10px" onclick="chooseLink(1,'/pages/money/transfer','余额转账')">余额转账</div>
				<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-left:10px;margin-top:10px" onclick="chooseLink(1,'/pages/money/recharge_offline','线下汇款')">线下汇款</div>

				<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-top:10px" onclick="chooseLink(1,'/pages/my/set','个人设置')">个人设置</div>
				<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-top:10px" onclick="chooseLink(1,'/pages/my/setpwd','登录密码')">登录密码</div>
				<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-top:10px" onclick="chooseLink(1,'/pages/address/index','收货地址')">收货地址</div>
				<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-top:10px" onclick="chooseLink(1,'/pages/index/login','用户登录')">用户登录</div>
				<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-top:10px" onclick="chooseLink(1,'/pages/my/history','足迹')">足迹</div>
				<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-top:10px" onclick="chooseLink(1,'/pages/my/favorite','收藏夹')">收藏夹</div>
				<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-top:10px" onclick="chooseLink(1,'/pages/my/myteam','粉丝')">粉丝</div>
				<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-top:10px" onclick="chooseLink(1,'/pages/money/shouyirelease','静态释放')">静态释放</div>
				<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-top:10px" onclick="chooseLink(1,'/pages/peisong/orderlist','配送单')">配送单</div>
				<div class="page-header" style="margin:10px 0 0 0;padding-bottom:0">
						<h4><i class="fa fa-folder-open-o"></i> 分销页面</h4>
				</div>
					<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-left:10px;margin-top:10px" onclick="chooseLink(1,'/pages/my/myteam','我的团队')">我的团队</div>
<!--					<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-top:10px" onclick="chooseLink(1,'/activity/commission/index','我的佣金')">我的佣金</div>-->
<!--					<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-top:10px" onclick="chooseLink(1,'/activity/commission/downorder','分销订单')">分销订单</div>-->
<!--					<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-top:10px" onclick="chooseLink(1,'/activity/commission/poster','分享海报')">分享海报</div>-->
				<div class="page-header" style="margin:10px 0 0 0;padding-bottom:0">
						<h4><i class="fa fa-folder-open-o"></i> 其他页面</h4>
				</div>
				<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-left:10px;margin-top:10px" onclick="chooseLink(1,'/pages/business/apply','商家入驻')">商家入驻</div>
				<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-top:10px" onclick="chooseLink(1,'/pages/business/blist','商家列表')">商家列表</div>
				<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-top:10px" onclick="chooseLink(1,'/pages/business/clist','分类商家')">分类商家</div>
				<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-top:10px" onclick="chooseLink(1,'/pages/maidan/pay','买单收款')">买单收款</div>
				<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-top:10px" onclick="chooseLink(1,'/pages/maidan/maidanlog','买单记录')">买单记录</div>
				<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-top:10px" onclick="chooseLink(1,'/pages/article/artlist','文章列表')">文章列表</div>
<!--				<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-top:10px" onclick="chooseLink(1,'/pagesExt/shortvideo/index','短视频')">短视频</div>-->


				<div class="page-header" style="margin:10px 0 0 0;padding-bottom:0">
					<h4><i class="fa fa-folder-open-o"></i> 扩展功能</h4>
				</div>
				<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-top:10px" onclick="chooseLink(1,'/pages/coupon/couponlist','领券中心')">领券中心</div>
				<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-top:10px" onclick="chooseLink(1,'/pages/coupon/mycoupon','我的优惠券')">我的优惠券</div>
				<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-left:10px;margin-top:10px" onclick="chooseLink(1,'/pages/kefu/index','AI聊天')">AI聊天</div>
<!--				<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-left:10px;margin-top:10px" onclick="chooseLink(1,'/pagesExt/imgai/create','百度AI绘画')">百度AI绘画</div>-->
<!--				<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-left:10px;margin-top:10px" onclick="chooseLink(1,'/pagesExt/mapmark/edit','地图标注')">地图标注</div>-->
<!--				<div class="layui-btn layui-btn-primary layui-btn-sm" style="margin-left:10px;margin-top:10px" onclick="chooseLink(1,'/pagesExt/videospider/analysis','短视频去水印')">短视频去水印</div>-->
			</div>
			<!--*****************************商品分类*****************************************-->
			<div class="layui-tab-item fe-tab-link" id="fe-tab-link-2">
				{foreach $clist as $pKey=>$c}
				<div>
					<div class="fe-tab-link-line" style='height:60px;line-height:60px;float:left;width:100%;'>
						<div class="fe-tab-link-sub"><a href="javascript:void(0);" onclick="chooseLinkCategory(2,'{$c.id}','{$c.name}')">选择</a></div>
						<div style="float:left;"></div>
						<div class="fe-tab-link-text" style="float:left;height: 40px;">
							{if !empty($c['child'])}<i class="layui-icon layui-icon-triangle-d" index={$pKey} type="parent" state="block" style="cursor: pointer;"></i>{/if}
							{$c.name}
						</div>
					</div>
				</div>
				<span class="parent_{$pKey}">
					{foreach $c['child'] as $ccKey=>$v}
					<div style="width:97%;float:right">
						<div class="fe-tab-link-line" style='height:60px;line-height:60px;float:left;width:100%;'>
							<div class="fe-tab-link-sub"><a href="javascript:void(0);" onclick="chooseLink(2,'/pages/shop/prolist?cid={$v.id}','{$v.name}')">选择</a></div>
							<div style="float:left;">
								{if !empty($v['pic'])}<img src="{$v.pic}" style='width:50px;height:50px;padding:1px;border:1px solid #ccc'/>{/if}
						</div>
						<div class="fe-tab-link-text" style="float:left;height: 40px;">
							{if !empty($v['child'])}<i class="layui-icon layui-icon-triangle-d" index={$pKey}{$cKey} type="child" state="block" style="cursor: pointer;"></i>{/if}
							{$v.name}
						</div>
						</div>
					</div>
						{foreach $v['child'] as $v2}
					<div style="width:94%;float:right" class="child_{$pKey}{$cKey}">
						<div class="fe-tab-link-line" style='height:60px;line-height:60px;float:left;width:100%;'>
							<div class="fe-tab-link-sub"><a href="javascript:void(0);" onclick="chooseLink(2,'/pages/shop/prolist?cid={$v2.id}','{$v2.name}')">选择</a></div>
							<div style="float:left;">
								{if !empty($v2['pic'])}<img src="{$v2.pic}" style='width:50px;height:50px;padding:1px;border:1px solid #ccc'/>{/if}
							</div>
							<div class="fe-tab-link-text" style="float:left">{$v2.name}</div>
						</div>
					</div>
						{/foreach}
					{/foreach}
				</span>
				{/foreach}
			</div>

			<!--*****************************商品分组*****************************************-->
			<div class="layui-tab-item fe-tab-link" id="fe-tab-link-3">
				{foreach $glist as $g}
				<div>
					<div class="fe-tab-link-line" style='height:60px;line-height:60px;float:left;width:100%;'>
						<div class="fe-tab-link-sub"><a href="javascript:void(0);" onclick="chooseLink(3,'/pages/shop/prolist?gid={$g.id}','{$g.name}')">选择</a></div>
						<div style="float:left;">
							{if $g['pic']}<img src="{$g.pic}" style='width:50px;height:50px;padding:1px;border:1px solid #ccc'/>{/if}
					</div>
					<div class="fe-tab-link-text" style="float:left">
						{$g.name}</div>
					</div>
				</div>
				{/foreach}
			</div>
			<!--*****************************商城商品*****************************************-->
			<div class="layui-tab-item fe-tab-link" id="fe-tab-link-4">
				<div class="layui-form layui-inline" style="margin-top:10px">
					<div class="layui-input-inline">
							<input type="text" class="layui-input" style="height:30px;" name="productname" value="" placeholder=请输入商品名称进行搜索>
					</div>
					<button type="button" class="layui-btn layui-btn-primary layui-btn-sm" lay-submit="" lay-filter="LAY-app-forumreply-search-product">搜索</button>
				</div>
				<div class="layui-col-md12" style="margin-top:5px">
					<table id="producttabledata" lay-filter="producttabledata"></table>
				</div>
			</div>

			<!--*****************************文章分类*****************************************-->
			<div class="layui-tab-item fe-tab-link" id="fe-tab-link-8">
				{foreach $aclist as $pKey=>$ac}
				<div>
					<div class="fe-tab-link-line" style='height:60px;line-height:60px;float:left;width:100%;'>
						<div class="fe-tab-link-sub"><a href="javascript:void(0);" onclick="chooseLink(9,'/pages/article/artlist?cid={$ac.cat_id}','{$ac.cat_name}')">选择</a></div>
						<div style="float:left;">
							{if !empty($v['pic'])}<img src="{$ac.pic}" style='width:50px;height:50px;padding:1px;border:1px solid #ccc'/>{/if}
					</div>
					<div class="fe-tab-link-text" style="float:left;height: 40px;">
						{if !empty($ac['child'])}<i class="layui-icon layui-icon-triangle-d" index={$pKey} type="parent" state="block" style="cursor: pointer;"></i>{/if}
						{$ac.cat_name}
					</div>
					</div>
				</div>
				{foreach $ac['child'] as $cKey=>$acv}
				<div style="width:97%;float:right" class="parent_{$pKey}">
					<div class="fe-tab-link-line" style='height:60px;line-height:60px;float:left;width:100%;'>
						<div class="fe-tab-link-sub"><a href="javascript:void(0);" onclick="chooseLink(9,'/pages/article/artlist?cid={$acv.cat_id}','{$acv.cat_name}')">选择</a></div>
						<div style="float:left;">
							{if !empty($acv['pic'])}<img src="{$acv.pic}" style='width:50px;height:50px;padding:1px;border:1px solid #ccc'/>{/if}
					</div>
					<div class="fe-tab-link-text" style="float:left">
						{$acv.cat_name}</div>
					</div>
				</div>
				{/foreach}
				{/foreach}
			</div>
			<!--*****************************文章*****************************************-->
			<div class="layui-tab-item fe-tab-link" id="fe-tab-link-9">
					<div class="layui-form layui-inline" style="margin-top:10px">
						<div class="layui-input-inline">
								<input type="text" class="layui-input" style="height:30px;" name="articlename" value="" placeholder=请输入文章标题进行搜索>
						</div>
						<button type="button" class="layui-btn layui-btn-primary layui-btn-sm" lay-submit="" lay-filter="LAY-app-forumreply-search-article">搜索</button>
					</div>
					<div class="layui-col-md12" style="margin-top:5px">
						<table id="articletabledata" lay-filter="articletabledata"></table>
					</div>
			</div>

			<!--*****************************商家分类*****************************************-->
			<div class="layui-tab-item fe-tab-link" id="fe-tab-link-10">
				{foreach $bclist as $bc}
				<div>
					<div class="fe-tab-link-line" style='height:60px;line-height:60px;float:left;width:100%;'>
						<div class="fe-tab-link-sub"><a href="javascript:void(0);" onclick="chooseLink(10,'/pagesExt/business/blist?cid={$bc.id}','{$bc.name}')">商家列表</a></div>
						<div class="fe-tab-link-sub"><a href="javascript:void(0);" onclick="chooseLink(10,'/pagesExt/business/clist?cid={$bc.id}','{$bc.name}')">分类商家</a></div>
						<div style="float:left;">
					</div>
					<div class="fe-tab-link-text" style="float:left">
						{$bc.name}</div>
					</div>
				</div>
				{/foreach}
			</div>

			<!--*****************************商家*****************************************-->
			<div class="layui-tab-item fe-tab-link" id="fe-tab-link-11">
				<div class="layui-form layui-inline" style="margin-top:10px">
					<div class="layui-input-inline">
							<input type="text" class="layui-input" style="height:30px;" name="businessname" value="" placeholder=请输入商家名称进行搜索>
					</div>
					<button type="button" class="layui-btn layui-btn-primary layui-btn-sm" lay-submit="" lay-filter="LAY-app-forumreply-search-business">搜索</button>
				</div>
				<div class="layui-col-md12" style="margin-top:5px">
					<table id="businesstabledata" lay-filter="businesstabledata"></table>
				</div>
			</div>
			<!--*****************************设计页面*****************************************-->
			<div class="layui-tab-item fe-tab-link" id="fe-tab-link-12">
				<div class="layui-form layui-col-md12" style="margin-top:10px">
					<div class="layui-inline">
						<div class="layui-input-inline">
								<input type="text" class="layui-input" name="designerpagename" value="" placeholder=请输入页面名称进行搜索>
						</div>
						<button type="button" class="layui-btn layui-btn-primary layui-btn-sm" lay-submit="" lay-filter="LAY-app-forumreply-search-designerpage">搜索</button>
					</div>
				</div>
				<div class="layui-col-md12" style="margin-top:5px">
					<table id="designerpagetabledata" lay-filter="designerpagetabledata"></table>
				</div>
			</div>
			<!--*****************************功能*****************************************-->
			<div class="layui-tab-item fe-tab-link" id="fe-tab-link-13">
				<div class="layui-form" lay-filter="" style="padding-top:20px">
				<div class="layui-form-item">
					<label class="layui-form-label" style="width:100px">选择功能：</label>
					<div class="layui-input-inline">
						<input type="radio" title="拨打电话" name="linktype" value="tel" lay-filter="linktype"/>
						<input type="radio" title="小程序客服" name="linktype" value="contact" lay-filter="linktype"/>
						<input type="radio" title="分享转发" name="linktype" value="share" lay-filter="linktype"/>
						<input type="radio" title="扫一扫" name="linktype" value="scan" lay-filter="linktype"/>
						<input type="radio" title="坐标导航" name="linktype" value="location" lay-filter="linktype"/>
						<input type="radio" title="跳转其他微信小程序" name="linktype" value="miniProgram" lay-filter="linktype"/>
						<input type="radio" title="复制文本" name="linktype" value="copy" lay-filter="linktype"/>
						<input type="radio" title="外部链接" name="linktype" value="url" lay-filter="linktype"/>
					</div>
					<div class="layui-form-mid layui-word-aux"></div>
				</div>
				<div id="linktype-content">
					<div class="layui-form-item tel" style="display:none">
						<label class="layui-form-label" style="width:100px">电话号码：</label>
						<div class="layui-input-inline">
							<input type="text" name="tel" value="" class="layui-input"/>
						</div>
					</div>
					<div class="layui-form-item contact" style="display:none">
						<label class="layui-form-label" style="width:100px"></label>
						<div class="layui-form-mid layui-word-aux">小程序在线客服仅支持以下组件：单图、按钮、悬浮按钮</div>
					</div>
					<div class="layui-form-item share" style="display:none">
						<label class="layui-form-label" style="width:100px"></label>
						<div class="layui-form-mid layui-word-aux">小程序分享转发仅支持以下组件：单图、按钮、悬浮按钮</div>
					</div>

					<div class="layui-form-item location" style="display:none">
						<label class="layui-form-label" style="width:100px">地点名称：</label>
						<div class="layui-input-inline">
							<input type="text" name="addressname" value="天安门广场" class="layui-input"/>
						</div>
					</div>
					<div class="layui-form-item location" style="display:none">
						<div class="layui-form-label" style="width:100px">经纬度：</div>
						<div class="layui-input-inline" style="width:150px">
							<input class="layui-input" name="longitude" value="116.397827"/>
						</div>
						<div class="layui-form-mid">,</div>
						<div class="layui-input-inline" style="width:150px">
							<input class="layui-input" name="latitude" value="39.90374"/>
						</div>
						<div class="layui-btn  layui-btn-primary" onclick="choosezuobiao()">选择坐标</div>
					</div>
					<div class="layui-form-item getmembercard" style="display:none">
						<label class="layui-form-label" style="width:100px"></label>
						<div class="layui-form-mid layui-word-aux">设置前请先创建微信会员卡</div>
					</div>
					<div class="layui-form-item url" style="display:none">
						<label class="layui-form-label" style="width:100px">链接地址：</label>
						<div class="layui-input-inline" style="width:300px">
							<input type="text" name="url" value="" class="layui-input"/>
						</div>
						<div class="layui-form-mid layui-word-aux" style="margin-left:130px">小程序跳转外部链接必须是https://开头的完整链接地址 可打开关联的公众号的文章，其它网页需登录<a href="https://mp.weixin.qq.com/" target="_blank">公众平台小程序账号</a>配置业务域名，个人类型与海外类型的小程序暂不支持使用。</div>
					</div>
					<div class="layui-form-item miniProgram" style="display:none">
						<label class="layui-form-label" style="width:100px">小程序 appId：</label>
						<div class="layui-input-inline">
							<input type="text" name="appid1" value="{$rwvideoad.unitid|default=''}" class="layui-input"/>
						</div>
						<div class="layui-form-mid layui-word-aux">要跳转的小程序AppID，此功能仅小程序或APP可用</div>
					</div>
					<div class="layui-form-item miniProgram" style="display:none">
						<label class="layui-form-label" style="width:100px">小程序原始id：</label>
						<div class="layui-input-inline">
							<input type="text" name="username" value="" class="layui-input"/>
						</div>
						<div class="layui-form-mid layui-word-aux">{if in_array('app',$platform)}APP及微信会员卡跳转小程序必填{/if}</div>
					</div>
					<div class="layui-form-item miniProgram" style="display:none">
						<label class="layui-form-label" style="width:100px">页面路径：</label>
						<div class="layui-input-inline">
							<input type="text" name="path1" value="" class="layui-input"/>
						</div>
						<div class="layui-form-mid layui-word-aux">不填写则默认打开首页</div>
					</div>
					<div class="layui-form-item miniProgram" style="display:none">
						<label class="layui-form-label" style="width:100px"></label>
					</div>

					<div class="layui-form-item embeddedMiniProgram" style="display:none">
						<label class="layui-form-label" style="width:100px">页面路径：</label>
						<div class="layui-input-inline">
							<input type="text" name="path2" value="" class="layui-input"/>
						</div>
						<div class="layui-form-mid layui-word-aux">不填写则默认打开首页</div>
					</div>
					<div class="layui-form-item copy" style="display:none">
						<label class="layui-form-label" style="width:100px">复制文字内容：</label>
						<div class="layui-input-inline" style="width:300px">
							<input type="text" name="copytext" value="" class="layui-input"/>
						</div>
						<div class="layui-form-mid layui-word-aux"></div>
					</div>
					<div class="layui-form-item copy" style="display:none">
						<label class="layui-form-label" style="width:100px">提示文字：</label>
						<div class="layui-input-inline" style="width:300px">
							<input type="text" name="copymsg" value="复制成功" class="layui-input"/>
						</div>
						<div class="layui-form-mid layui-word-aux">复制后提示文字</div>
					</div>
				</div>

				<div class="layui-form-item">
					<div class="layui-input-block" style="margin-left:130px;">
						<button class="layui-btn" lay-submit lay-filter="formsubmit">确 定</button>
					</div>
				</div>
				</div>
			</div>

		</div>
	</div>
	</div>
</div>
</div>

<script>
	layui.use(function () {
		layui.form.on('radio(linktype)', function(data){
			$('#linktype-content .layui-form-item').hide();
			$('.layui-form-item.'+data.value).show();
		})

		layui.form.on('submit(formsubmit)', function(obj){
			var field = obj.field
			var linktype = field.linktype
			var linkval = '';
			var hrefname = '';
			if(!linktype){
				layer.msg('请选择功能');return;
			}
			if(linktype == 'tel'){
				if(field.tel == ''){
					layer.msg('请填写电话号码');return;
				}
				linkval = field.tel
				hrefname = '拨打电话:'+field.tel;
			}
			if(linktype == 'url'){
				if(field.url == ''){
					layer.msg('请填写链接地址');return;
				}
				linkval = field.url
				hrefname = '外部链接:'+field.url;
			}
			if(linktype == 'contact'){
				hrefname = '在线客服';
			}
			if(linktype == 'scan'){
				hrefname = '扫一扫';
			}
			if(linktype == 'share'){
				hrefname = '分享转发';
			}
			if(linktype == 'location'){
				hrefname = '坐标导航';
				linkval = $('input[name=addressname]').val() + '|' + $('input[name=longitude]').val() + ','+$('input[name=latitude]').val();
			}
			if(linktype == 'getmembercard'){
				hrefname = '领取会员卡';
			}
			if(linktype == 'miniProgram'){
				if(field.appid1 == ''){
					//layer.msg('请填写小程序appid');return;
				}
				console.log(field)
				if(field.username){
					linkval = field.appid1 + '|'+field.path1 + '|'+field.username;
				}else{
					linkval = field.appid1 + '|'+field.path1+'|';
				}
				hrefname = '小程序:'+linkval;
			}
			if(linktype =='embeddedMiniProgram'){
				hrefname = '半屏小程序';
				linkval = field.appid2+'|'+field.path2;
			}
			if(linktype == 'copy'){
				hrefname = '复制';
				linkval = $('input[name=copytext]').val() + '|' + $('input[name=copymsg]').val();
			}
			if(linktype == 'rewardedVideoAd'){
				linkval = field.rad_unitid + '|'+field.rad_givescore + '|'+field.rad_givetimes;
				hrefname = '激励广告:'+field.rad_unitid;
				var index = layer.load();
				$.post("{:url('addRewardedVideoAd')}",{id:'{$rwvideoad.id}',type:0,unitid:field.rad_unitid,givescore:field.rad_givescore,givemoney:field.rad_givemoney,givemoneyparent:field.rad_givemoneyparent,givetimes:field.rad_givetimes,givetimestotal:field.rad_givetimestotal,rad_url:field.rad_url},function(res){
					chooseLink(13,linktype+'::'+res.adid,hrefname);
					layer.close(index);
				});
				return;
			}
			if(linktype == 'sendsms'){
				hrefname = '发送短信';
				linkval = field.sendsms_tmpl + '|'+field.sendsms_link;
			}
			if(linktype == 'url'){
				var hrefurl = linkval;
			}else if(linktype == 'tel'){
				var hrefurl = linktype + ':' + linkval;
			}else{
				var hrefurl = linktype + '::' + linkval;
			}
			chooseLink(13,hrefurl,hrefname)
		});
	})


	var chooseUrlField = '';
	function chooseUrl2(field){
		chooseUrlField = field;
		layer.open({type:2,shadeClose:true,area:['900px', '550px'],'title':'选择链接',content:"{:url('DesignerPage/chooseurl')}&callback=chooseLink2"});
	}
	function chooseLink2(urlname,url){
		$("#"+chooseUrlField).val(url);
	}
</script>
<script type="text/html" id="productnameTpl">
		<img src="{{d.original_img}}" style="max-width:70px;float:left"/>
		<div style="float: left;width:200px;margin-left: 10px;white-space:normal;line-height:20px;">
			<div style="width:100%;">{{# if(d.cid!=0){ }}<span style="color:red">[{{d.cname}}]</span>{{# } }}{{d.goods_name}}</div>
			<div style="padding-top:5px;color:#f60">￥{{d.shop_price}}</div></div>
		</div>
</script>
<script type="text/html" id="articlenameTpl">
		<img src="{{d.thumb}}" style="max-height:50px;max-width:50px;float:left"/>
		<div style="float: left;width:200px;margin-left: 10px;white-space:normal;line-height:20px;">
			<div style="width:100%;padding-top:5px">{{# if(d.cat_id>0){ }}<span style="color:red">[{{d.cat_name}}] </span>{{# } }}{{d.title}}</div>
			<div style="padding-top:5px;font-size:12px">{{d.author}}</div></div>
		</div>
	</script>
	<script type="text/html" id="kanjianameTpl">
		<img src="{{d.pic}}" style="max-width:70px;float:left"/>
		<div style="float: left;width:200px;margin-left: 10px;white-space:normal;line-height:20px;">
			<div style="width:100%;">{{d.name}}</div>
			<div style="color:#666;font-size:12px">原价: ￥{{d.sell_price}}</div>
			<div style="color:#f60;font-size:12px">最低价: ￥{{d.min_price}}</div>
		</div>
	</script>
	<script type="text/html" id="collagenameTpl">
		<img src="{{d.pic}}" style="max-width:70px;float:left"/>
		<div style="float: left;width:200px;margin-left: 10px;white-space:normal;line-height:20px;">
			<div style="width:100%;">{{# if(d.cid!=0){ }}<span style="color:red">[{{d.cname}}]</span>{{# } }}{{d.name}}</div>
			<div style="padding-top:5px;color:#f60">￥{{d.sell_price}}</div></div>
		</div>
	</script>
	<script type="text/html" id="scoreshopnameTpl">
		<img src="{{d.pic}}" style="max-width:70px;float:left"/>
		<div style="float: left;width:200px;margin-left: 10px;white-space:normal;line-height:20px;">
			<div style="width:100%;">{{d.name}}</div>
			<div style="color:#666;font-size:12px">价值: ￥{{d.sell_price}}</div>
			<div style="color:#f60;font-size:12px">{{d.score_price}}{:t('积分')} {{# if(d.money_price>0){ }}+ {{d.money_price}}元{{# } }}</div>
		</div>
	</script>
	<script type="text/html" id="yuyuenameTpl">
		<img src="{{d.pic}}" style="max-width:70px;float:left"/>
		<div style="float: left;width:200px;margin-left: 10px;white-space:normal;line-height:20px;">
			<div style="width:100%;">{{# if(d.cid!=0){ }}<span style="color:red">[{{d.cname}}]</span>{{# } }}{{d.name}}</div>
			<div style="padding-top:5px;color:#f60">￥{{d.sell_price}}</div></div>
		</div>
	</script>
<script type="text/html" id="restaurant_productnameTpl">
	<img src="{{d.pic}}" style="max-width:70px;float:left"/>
	<div style="float: left;width:200px;margin-left: 10px;white-space:normal;line-height:20px;">
		<div style="width:100%;">{{# if(d.cid!=0){ }}<span style="color:red">[{{d.cname}}]</span>{{# } }}{{d.name}}</div>
		<div style="padding-top:5px;color:#f60">￥{{d.sell_price}}</div></div>
	</div>
</script>
<script>
	layui.use(function () {
  //商品列表
	var productdatawhere = {};
  var tableInsproduct = layui.table.render({
    elem: '#producttabledata'
    ,url: "{:url('Goods/index')}" //数据接口
    ,page: true //开启分页
		,width:1068
		,height:480
    ,cols: [[ //表头
			//{type:"checkbox"},
      {field: 'id', title: 'ID',  sort: true,width:80},
      {field: 'name', title: '商品信息',templet: '#productnameTpl',width:450},
      //{field: 'ggdata', title: '规格 × 库存'},
      {field: 'on_time', title: '创建时间',sort: true,templet:function(d){ return date('Y-m-d H:i',d.createtime)},width:150},
      {field: 'status', title: '状态',templet:function(d){ return d.status==1?'<span style="color:green">已上架</span>':'<span style="color:red">未上架</span>'},width:80},
      {field: 'operation', title: '操作',templet: '<div><button class="table-btn" onclick="chooseLink(4,\'/pages/shop/product?id={{d.goods_id}}\',\'{{d.goods_name}}\')">选择</button></div>'}
    ]]
  });
	//排序
	layui.table.on('sort(producttabledata)', function(obj){
		productdatawhere.field = obj.field;
		productdatawhere.order = obj.type;
		tableInsproduct.reload({
			initSort: obj,
			where: productdatawhere
		});
	});
	//检索
	layui.form.on('submit(LAY-app-forumreply-search-product)', function(obj){
		var olddatawhere = productdatawhere
		productdatawhere = {name:obj.field.productname}
		productdatawhere.field = olddatawhere.field
		productdatawhere.order = olddatawhere.order
		console.log(productdatawhere)
		tableInsproduct.reload({
			where: productdatawhere,
			page: {curr: 1}
		});
	})

  //设计页面列表
	var designerpagedatawhere = {};
  var tableInsdesignerpage = layui.table.render({
    elem: '#designerpagetabledata'
    ,url: "{:url('DesignPage/index')}/ishome/0" //数据接口
    ,page: true //开启分页
		,width:1068
		,height:480
    ,cols: [[ //表头
			//{type:"checkbox"},
      {field: 'id', title: 'ID',  sort: true,width:80},
      {field: 'name', title: '页面名称',templet: '<div>{{# if(d.ishome==1){ }}<i class="fa fa-home" title="小程序首页" style="color:#fb6b5b;font-size:20px"></i> {{# } }}{{d.name}}</div>',width:403},
      //{field: 'readcount', title: '页面链接',templet: '<div>/pages/main/main?PageId={{d.id}}</div>'},
      //{field: 'sort', title: '序号',width:80,sort: true},
      //{field: 'createtime', title: '创建时间',sort: true,templet:function(d){ return date('Y-m-d H:i',d.createtime)},width:150},
      {field: 'updatetime', title: '最后修改时间',sort: true,templet:function(d){ return date('Y-m-d H:i',d.updatetime)},width:200},
      {field: 'operation', title: '操作',templet: function(d){
				var html = '';
				html += '<button class="table-btn" class="layui-btn" onclick="chooseLink(12,\'/pages/index/main?id='+d.id+'\',\''+d.name+'\')">选择</button>';
				html += '<button class="table-btn" class="layui-btn" onclick="chooseLink(12,\'/pages/index/main?id='+d.id+'&reloadthispage=1\',\''+d.name+'\')">当前页加载</button>';
				return html;
      }}
    ]]
  });
	//排序
	layui.table.on('sort(designerpagetabledata)', function(obj){
		designerpagedatawhere.field = obj.field;
		designerpagedatawhere.order = obj.type;
		tableInsdesignerpage.reload({
			initSort: obj,
			where: designerpagedatawhere
		});
	});
	//检索
	layui.form.on('submit(LAY-app-forumreply-search-designerpage)', function(obj){
		//var field = obj.field
		var olddatawhere = designerpagedatawhere
		designerpagedatawhere = {name:obj.field.designerpagename}
		designerpagedatawhere.field = olddatawhere.field
		designerpagedatawhere.order = olddatawhere.order
		console.log(obj.field)
		if(obj.field.designerpagecid){
			designerpagedatawhere.cid = obj.field.designerpagecid
		}
		if(obj.field.designerpageremark){
			designerpagedatawhere.remark = obj.field.designerpageremark
		}
		tableInsdesignerpage.reload({
			where: designerpagedatawhere,
			page: {curr: 1}
		});
	})
  //文章列表
	var articledatawhere = {};
  var tableInsarticle = layui.table.render({
    elem: '#articletabledata'
    ,url: "{:url('Article/index')}" //数据接口
    ,page: true //开启分页
		,width:1068
		,height:480
    ,cols: [[ //表头
			//{type:"checkbox"},
      {field: 'id', title: 'ID',  sort: true,width:80},
      {field: 'name', title: '文章信息',templet: '#articlenameTpl'},
      {field: 'add_time', title: '创建时间',sort: true,templet:function(d){ return date('Y-m-d H:i',d.createtime)},width:200},
      //{field: 'sendtime', title: '发布时间',sort: true,templet:function(d){ return date('Y-m-d H:i',d.sendtime)},width:120},
      {field: 'status', title: '状态',templet:function(d){ return d.status==1?'<span style="color:green">已发布</span>':'<span style="color:red">未发布</span>'},width:150},
      {field: 'operation', title: '操作',templet: '<div><button class="table-btn" onclick="chooseLink(9,\'/pages/article/detail?id={{d.id}}\',\'{{d.name}}\')">选择</button></div>',width:100}
    ]]
  });
	//排序
	layui.table.on('sort(articletabledata)', function(obj){
		articledatawhere.field = obj.field;
		articledatawhere.order = obj.type;
		tableInsarticle.reload({
			initSort: obj,
			where: articledatawhere
		});
	});
	//检索
	layui.form.on('submit(LAY-app-forumreply-search-article)', function(obj){
		var field = obj.field
		var olddatawhere = articledatawhere
		articledatawhere = {name:obj.field.articlename}
		articledatawhere.field = olddatawhere.field
		articledatawhere.order = olddatawhere.order
		tableInsarticle.reload({
			where: articledatawhere,
			page: {curr: 1}
		});
	})
	//商家列表
	var businessdatawhere = {};
  var tableInsbusiness = layui.table.render({
    elem: '#businesstabledata'
    ,url: "{:url('suppliers/index')}" //数据接口
    ,page: true //开启分页
		,width:1068
		,height:480
    ,cols: [[ //表头
			//{type:"checkbox"},
      {field: 'id', title: 'ID',  sort: true,width:80},
      {field: 'name', title: '商家名称'},
      {field: 'pic', title: '商家图片',templet:function(d){
				return '<img src="'+d.logo+'" style="width:60px;height:60px"/>'
      }},
      {field: 'createtime', title: '创建时间',sort: true,templet:function(d){ return date('Y-m-d H:i',d.createtime)},width:200},
      //{field: 'sendtime', title: '发布时间',sort: true,templet:function(d){ return date('Y-m-d H:i',d.sendtime)},width:120},
      {field: 'status', title: '状态',width:150,templet:function(d){
				if(d.status==1){
					return '<span style="color:green">已通过</span>'
				}else if(d.status==2){
					return '<span style="color:red">未通过</span>'
				}else{
					return '<span>审核中</span>'
				}
			}},
      {field: 'operation', title: '操作',templet: '<div><button class="table-btn" onclick="chooseLink(9,\'/pagesExt/business/index?id={{d.id}}\',\'{{d.name}}\')">选择</button></div>',width:100}
    ]]
  });
	//排序
	layui.table.on('sort(businesstabledata)', function(obj){
		businessdatawhere.field = obj.field;
		businessdatawhere.order = obj.type;
		tableInsbusiness.reload({
			initSort: obj,
			where: businessdatawhere
		});
	});
	//检索
	layui.form.on('submit(LAY-app-forumreply-search-business)', function(obj){
		var field = obj.field
		var olddatawhere = businessdatawhere
		businessdatawhere = {name:obj.field.businessname}
		businessdatawhere.field = olddatawhere.field
		businessdatawhere.order = olddatawhere.order
		tableInsbusiness.reload({
			where: businessdatawhere,
			page: {curr: 1}
		});
	})
	})
	$(".layui-icon").click(function(){
		let type = $(this).attr('type');
		let state = $(this).attr('state');
		let index = $(this).attr('index');
		if(type=='parent'){
			if(state=='block'){
				$(".parent_" + index).hide();
			}
			if(state=='hide'){
				$(".parent_" + index).show();
			}
		}
		if(type=='child'){
			if(state=='block'){
				$(".child_" + index).hide();
			}
			if(state=='hide'){
				$(".child_" + index).show();
			}
		}
		if(state=='block'){
			$(this).removeClass("layui-icon-triangle-d")
			$(this).addClass("layui-icon-triangle-r");
			$(this).attr('state','hide');
		}
		if(state=='hide'){
			$(this).addClass("layui-icon-triangle-d")
			$(this).removeClass("layui-icon-triangle-r");
			$(this).attr('state','block');
		}
	})
	
	function chooseLinkCategory(type,cid,hrefname){
		var html = '';
		html+='<div style="margin:auto auto;text-align:center">';
		html+='	<div style="display:flex;justify-content:center;margin-top:40px;color:#333;font-size:16px;">';
		html+='		<a style="margin:0 10px;width:100px;height:50px;line-height:50px;background:#fff;border:1px solid #e7e7eb;border-radius:5px;text-align:center;position:relative;cursor:pointer" onclick="chooseLink(\''+type+'\',\'/pages/shop/prolist?cid='+cid+'\',\''+hrefname+'\')">商品列表</a>';
		html+='		<a style="margin:0 10px;width:100px;height:50px;line-height:50px;background:#fff;border:1px solid #e7e7eb;border-radius:5px;text-align:center;position:relative;cursor:pointer" onclick="chooseLink(\''+type+'\',\'/pages/shop/classify?cid='+cid+'\',\''+hrefname+'\')">分类商品</a>';
		html+='		<div style="margin:0 10px;width:100px;height:50px;line-height:50px;background:#fff;border:1px solid #e7e7eb;border-radius:5px;text-align:center;position:relative;cursor:pointer" onclick="chooseLink(\''+type+'\',\'/pages/shop/classify2?cid='+cid+'\',\''+hrefname+'\')">分类商品2</div>';
		html+='		<div style="margin:0 10px;width:100px;height:50px;line-height:50px;background:#fff;border:1px solid #e7e7eb;border-radius:5px;text-align:center;position:relative;cursor:pointer" onclick="chooseLink(\''+type+'\',\'/pages/shop/fastbuy?cid='+cid+'\',\''+hrefname+'\')">快速购买</div>';
		html+='		<div style="margin:0 10px;width:100px;height:50px;line-height:50px;background:#fff;border:1px solid #e7e7eb;border-radius:5px;text-align:center;position:relative;cursor:pointer" onclick="chooseLink(\''+type+'\',\'/pages/shop/fastbuy2?cid='+cid+'\',\''+hrefname+'\')">快速购买2</div>';
		html+='	</div>'
		html+='</div>'
		layer.open({type:1,area:['600px','220px'],content:html,title:'请选择链接',shadeClose:true})
	}
	var request_type = '{$type}';
	var request_callback = '{$callback}';
	function chooseLink(type,hrefurl,hrefname){

			if(request_type=='geturl'){
				var pagepath = hrefurl.substr(1);

				url = '{:getCurUrl()}/h5/index.html#/'+pagepath;
				var html = '';
				html+='<div style="margin:20px">';
				html+='	<div style="width:100%;margin:10px 0" id="urlqr"></div>';

				html+='	<div style="width:100%;text-align:center"><button class="layui-btn layui-btn-sm layui-btn-primary" onclick="showwxqrcode(\''+pagepath+'\')">查看小程序码</button></div>';

					html+='	<div style="margin-top:30px;height:50px;line-height:25px;">链接地址：<button class="layui-btn layui-btn-xs layui-btn-primary" onclick="copyText(\''+url+'\')">复制</button><br>'+url+'</div>';
					html+='	<div style="height:50px;line-height:25px;">页面路径：<button class="layui-btn layui-btn-xs layui-btn-primary" onclick="copyText(\'/'+pagepath+'\')">复制</button><br>/'+pagepath+'</div>';
					html+='</div>'
					layer.open({type:1,'title':'链接地址',area:['650px','480px'],shadeClose:true,'content':html})
					var qrcode = new QRCode('urlqr', {
						text: 'your content',
						width: 200,
						height: 200,
						colorDark : '#000000',
						colorLight : '#ffffff',
						correctLevel : QRCode.CorrectLevel.L
					});
					qrcode.clear();
					qrcode.makeCode(url);
			}else{
				var urlname = $('#fe-tab-link-nav-' + type).text() + '>' + hrefname

					window.parent.chooseLink(urlname,hrefurl,"{:input('args')}");

				//closeself();
			}
	}
	function showwxqrcode(pagepath){
		var index = layer.load();
		$.post("{:url('getwxqrcode')}",{path:pagepath},function(res){
			layer.close(index);
			if(res.status==0){
				//dialog(res.msg);
				layer.open({type:1,area:['300px','350px'],content:'<div style="margin:auto auto;text-align:center"><div style="color:red;width:280px;height:180px;margin-top:100px">'+res.msg+'</div><div style="height:25px;line-height:25px;">'+pagepath+'</div></div>',title:false,shadeClose:true})
			}else{
				layer.open({type:1,area:['300px','350px'],content:'<div style="margin:auto auto;text-align:center"><img src="'+res.url+'" style="margin-top:20px;max-width:280px;max-height:280px"/><div style="height:25px;line-height:25px;">'+pagepath+'</div></div>',title:false,shadeClose:true})
			}
		})
	}
	function copyText(text) {
			var textarea = document.createElement("textarea"); //创建input对象
			var currentFocus = document.activeElement; //当前获得焦点的元素
			var toolBoxwrap = document.getElementById('NewsToolBox'); //将文本框插入到NewsToolBox这个之后
			toolBoxwrap.appendChild(textarea); //添加元素
			textarea.value = text;
			textarea.focus();
			if (textarea.setSelectionRange) {
					textarea.setSelectionRange(0, textarea.value.length); //获取光标起始位置到结束位置
			} else {
					textarea.select();
			}
			try {
					var flag = document.execCommand("copy"); //执行复制
			} catch (eo) {
					var flag = false;
			}
			toolBoxwrap.removeChild(textarea); //删除元素
			currentFocus.focus();
			if(flag) layer.msg('复制成功');
			return flag;
	}

	function choosezuobiao(address,jd,wd){
		var address = $('input[name=address]').val();
		var jd = $('input[name=longitude]').val();
		var wd = $('input[name=latitude]').val();
		if(!jd){
			jd = '116.397827';
			wd = '39.90374';
		}
		var choosezblayer = layer.open({type:2,shadeClose: true,area: ['800px', '560px'],'title': '选择坐标',content: "{:url('DesignerPage/choosezuobiao')}/Mid/1&address="+(address?address:'')+'&jd='+(jd?jd:'')+'&wd='+(wd?wd:''),btn:['确定','取消'],yes:function(index, layero){
				var longitude = layero.find('iframe').contents().find('#mapjd').val();
				var latitude = layero.find('iframe').contents().find('#mapwd').val();
				$('input[name=longitude]').val(longitude);
				$('input[name=latitude]').val(latitude);
				layer.close(choosezblayer);
			}
		});
	}
</script>
<div id="NewsToolBox"></div>
<!-- <script src="__STATIC__/admin/js/clipboard.min.js"></script> -->
</body>
</html>